package com.groupwork.meeting.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

import java.util.List;
import java.util.Objects;
import java.util.Set;

/**
 * @author 鱼凫
 * @version 1.0
 * Create by 2021/10/27 23:55
 * @Description //TODO 用户实体类
 */
public class User {
    private String userId;
    private String userName;
    private String userPwd;
    private String salt;
    private String uPresident;
    private String urname;
    private String usex;
    private String phone;
    private String Email;
    private String userRole;
    @TableField(exist = false)
    private List<Role> roles;
    @TableField(exist = false)
    private List<Power> powers;


    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getUserPwd() {
        return userPwd;
    }

    public void setUserPwd(String userPwd) {
        this.userPwd = userPwd;
    }

    public String getSalt() {
        return salt;
    }

    public void setSalt(String salt) {
        this.salt = salt;
    }

    public String getuPresident() {
        return uPresident;
    }

    public void setuPresident(String uPresident) {
        this.uPresident = uPresident;
    }

    public String getUrname() {
        return urname;
    }

    public void setUrname(String urname) {
        this.urname = urname;
    }

    public String getUsex() {
        return usex;
    }

    public void setUsex(String usex) {
        this.usex = usex;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getEmail() {
        return Email;
    }

    public void setEmail(String email) {
        Email = email;
    }

    public String getUserRole() {
        return userRole;
    }

    public void setUserRole(String userRole) {
        this.userRole = userRole;
    }

    public List<Role> getRoles() {
        return roles;
    }

    public void setRoles(List<Role> roles) {
        this.roles = roles;
    }

    public List<Power> getPowers() {
        return powers;
    }

    public void setPowers(List<Power> powers) {
        this.powers = powers;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (!(o instanceof User)) return false;
        User user = (User) o;
        return Objects.equals(getUserId(), user.getUserId()) && Objects.equals(getUserName(), user.getUserName()) && Objects.equals(getUserPwd(), user.getUserPwd()) && Objects.equals(getSalt(), user.getSalt()) && Objects.equals(getuPresident(), user.getuPresident()) && Objects.equals(getUrname(), user.getUrname()) && Objects.equals(getUsex(), user.getUsex()) && Objects.equals(getPhone(), user.getPhone()) && Objects.equals(getEmail(), user.getEmail()) && Objects.equals(getUserRole(), user.getUserRole()) && Objects.equals(getRoles(), user.getRoles()) && Objects.equals(getPowers(), user.getPowers());
    }

    @Override
    public int hashCode() {
        return Objects.hash(getUserId(), getUserName(), getUserPwd(), getSalt(), getuPresident(), getUrname(), getUsex(), getPhone(), getEmail(), getUserRole(), getRoles(), getPowers());
    }

    @Override
    public String toString() {
        return "User{" +
                "userId='" + userId + '\'' +
                ", userName='" + userName + '\'' +
                ", userPwd='" + userPwd + '\'' +
                ", salt='" + salt + '\'' +
                ", uPresident='" + uPresident + '\'' +
                ", urname='" + urname + '\'' +
                ", usex='" + usex + '\'' +
                ", phone='" + phone + '\'' +
                ", Email='" + Email + '\'' +
                ", userRole='" + userRole + '\'' +
                ", roles=" + roles +
                ", powers=" + powers +
                '}';
    }


}
